package com.yuanfeng.business.controller;

import com.yuanfeng.business.dto.ShopSupplierDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ShopSupplierController
 * @Description
 * @Author hyq
 * @Date 2023/8/3 11:33
 * @Version 1.0
 **/
@RestController
@RequestMapping("/shop/supplier")
public class ShopSupplierController extends BaseController{


    /**
     * 新增或更新自销产品供货商
     *
     * @param param
     * @return
     */
    @PostMapping("/add")
    public ResponseResult addShopSupplier(@RequestBody ShopSupplierDTO param) {
        ResponseResult result=shopSupplierService.addShopSupplier(param);
        return result;
    }

    /**
     * 删除自销商品供应商
     *
     * @param param
     * @return
     */
    @PostMapping("/delete")
    public ResponseResult delShopSupplier(@RequestBody ShopSupplierDTO param) {
        ResponseResult result=shopSupplierService.delShopSupplier(param);
        return result;
    }


    /**
     * 查询自销商品供应商列表
     *
     * @param param
     * @return
     */
    @PostMapping("/query/list")
    public ResponseResult queryShopSupplierList(@RequestBody ShopSupplierDTO param) {
        ResponseResult result=shopSupplierService.queryShopSupplierList(param);
        return result;
    }

}
